package com.zjsd.sqeybusiness.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zjsd.sqeybusiness.mapper.CompanyImageMapper;
import com.zjsd.sqeybusiness.domain.CompanyImage;
import com.zjsd.sqeybusiness.service.ICompanyImageService;

/**
 * 企业图片Service业务层处理
 *
 * @author Zheng
 * @date 2020-11-05
 */
@Service
public class CompanyImageServiceImpl implements ICompanyImageService
{
    @Autowired
    private CompanyImageMapper companyImageMapper;

    /**
     * 查询企业图片
     *
     * @param imageId 企业图片ID
     * @return 企业图片
     */
    @Override
    public CompanyImage selectCompanyImageById(Long imageId)
    {
        return companyImageMapper.selectCompanyImageById(imageId);
    }

    /**
     * 查询企业图片列表
     *
     * @param companyImage 企业图片
     * @return 企业图片
     */
    @Override
    public List<CompanyImage> selectCompanyImageList(CompanyImage companyImage)
    {
        return companyImageMapper.selectCompanyImageList(companyImage);
    }

    /**
     * 新增企业图片
     *
     * @param companyImage 企业图片
     * @return 结果
     */
    @Override
    public int insertCompanyImage(CompanyImage companyImage)
    {
        companyImage.setCreateTime(DateUtils.getNowDate());
        return companyImageMapper.insertCompanyImage(companyImage);
    }

    /**
     * 修改企业图片
     *
     * @param companyImage 企业图片
     * @return 结果
     */
    @Override
    public int updateCompanyImage(CompanyImage companyImage)
    {
        companyImage.setUpdateTime(DateUtils.getNowDate());
        return companyImageMapper.updateCompanyImage(companyImage);
    }

    /**
     * 批量删除企业图片
     *
     * @param imageIds 需要删除的企业图片ID
     * @return 结果
     */
    @Override
    public int deleteCompanyImageByIds(Long[] imageIds)
    {
        return companyImageMapper.deleteCompanyImageByIds(imageIds);
    }

    /**
     * 删除企业图片信息
     *
     * @param imageId 企业图片ID
     * @return 结果
     */
    @Override
    public int deleteCompanyImageById(Long imageId)
    {
        return companyImageMapper.deleteCompanyImageById(imageId);
    }
}
